# -*- coding: utf-8; mode: snippet -*-
# name: avoid doing sth too frequently
# key: timeout
# contributor: Chen Bin <chenbin DOT sh AT gmail>
# --
if(!${1:timer}) {
  ${1:$(yas/substr yas-text "[^:=, ]*")} = setTimeout(() => {
    ${1:$(yas/substr yas-text "[^:=, ]*")} = null;
    // do something here
  }, 250);
}